package com.abigdreamer.im.server.DB.dao;

import java.util.ArrayList;
import java.util.List;

import com.abigdreamer.im.server.log.EIMLogger;
import com.abigdreamer.im.server.module.vo.MsgTeam;
import com.abigdreamer.im.server.module.vo.MsgUser;

/**
 * 
 */
public class TeamDao extends BaseDao implements IDAO {

	List<MsgTeam> allTeamList=new ArrayList<MsgTeam>();
	
	public List<MsgTeam> getAllTeam(){
		UserDao userDao=new UserDao();
		EIMLogger.INFO("开始初始所有群信息列表！");
		for(int i=0;i<10;i++){
			MsgTeam team=new MsgTeam();
			team.setGroupID(Integer.toString(6666+i));
			team.setGroupName(Name.getTeamName(i%4));
			List<MsgUser> userList=new ArrayList<MsgUser>();
			for(int k=0;k<10;k++){
				//80000-80099
				String userID=Integer.toString(i*10+k+80000);
				userList.add(userDao.getUserByID(userID));
				if(k==0){
					team.setGroupOwerID(userID);
				}
			}
			team.setUserList(userList);
			allTeamList.add(team);
			EIMLogger.INFO(team);
		}
		EIMLogger.INFO("所有群信息列表 初始完成！");
		return allTeamList;
	}
	
}
